package com.day21.exer;

import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

public class ListExer {
    /*
    区分List中remove(int index)和remove(Object obj)
     */
    @Test
    public void testListRemove(){
        List list = new ArrayList();
        list.add(1);
        list.add(2);
        list.add(3);
        updateList(list);
        System.out.println(list);//12
    }
    private void updateList(List list){
//        list.remove(2);//删索引
        list.remove(new Integer(2));//删数据

    }
}
